﻿@using System.Web.Mvc.Html
@using SimpleScrum.Utils

@model SimpleScrum.Core.Entities.Sprint
@{
    ViewBag.Title = "New Sprint";
}
<div class="breadcrumbs" id="breadcrumbs">
    <ul class="breadcrumb">
        <li>
            <i class="icon-home home-icon"></i>
            <a href="@Url.Action("Index","DashBoard")">Home</a>
            <span class="divider">
                <i class="icon-angle-right arrow-icon"></i>
            </span>
        </li>
        <li>
            <a href="@Url.Action("Details", "Project", new {id=@Client.Instance.CurrentProjectId})">Project</a>
            <span class="divider">
                <i class="icon-angle-right arrow-icon"></i>
            </span>
        </li>
        <li>
            <a href="@Url.Action("Index", "Sprint", new {projectId=@Client.Instance.CurrentProjectId})">Sprints</a>
            <span class="divider">
                <i class="icon-angle-right arrow-icon"></i>
            </span>
        </li>
        <li class="active">New Sprint</li>
    </ul>
    <div class="nav-search pull-right">
        <a class="btn btn-small btn-success" href="@Url.Action("Index","Sprint", new {projectId=@Client.Instance.CurrentProjectId}))">
            <i class="icon-plus-sign-alt"></i>All Sprints
        </a>
    </div>
</div>
<div class="page-content">
    <div class="page-header position-relative">
        <h1>@ViewBag.Title<small><i class="icon-double-angle-right"></i>@ViewBag.Message</small></h1>
    </div><!--/.page-header-->
    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box form-horizontal">
                <div class="widget-header">
                    <h4>Insert Sprint Information New Form</h4>
                </div>
                <div class="widget-body">
                    <div class="widget-main no-padding">
                        @using (Html.BeginForm()) {
                            @Html.AntiForgeryToken()
                            <div class="text-error">
                                @Html.ValidationSummary("Please enter valid Data!")
                            </div>
                            <fieldset >
                                <div class="control-group">
                                    @Html.LabelFor(model => model.Name, new {@class="control-label", @for="form-field-1"})
                                    <div class="controls">
                                        @Html.TextBoxFor(model => model.Name, new {@class="span10", @id="form-field-1", @placeholder="Sprint Name"})
                                        <span class="help-inline">*</span>
                                        <div class="text-warning">@Html.ValidationMessageFor(model => model.Name)</div>
                                    </div>
                                </div>
                                <div class="control-group">
                                    @Html.LabelFor(model => model.Description, new {@class="control-label", @for="form-field-2"})
                                    <div class="controls">
                                        @Html.TextAreaFor(model => model.Description,new {@class="span10 limited", id="form-field-2", @rows="5", placeholder="Sprint Description"})
                                        <div class="text-warning">@Html.ValidationMessageFor(model => model.Description)</div>
                                    </div>
                                </div>
                            
                                <div class="control-group">
                                    @Html.LabelFor(model => model.StartDate, new {@class="control-label", @for="form-field-2"})
                                    <div class="controls">
                                        @Html.TextBoxFor(model => model.StartDate,new {@type="date", @class="span4 limited", @_id=" popupDatepicker"})
                                        @*<p>A popup datepicker <input type="text" id="popupDatepicker"></p>*@
                                        <div class="text-warning">@Html.ValidationMessageFor(model => model.StartDate)</div>
                                    </div>
                                </div>

                                <div class="control-group">
                                    @Html.LabelFor(model => model.EndDate, new {@class="control-label", @for="form-field-2"})
                                    <div class="controls">
                                        @Html.TextBoxFor(model => model.EndDate,new {@type="date", @class="span4 limited", id="form-field-2 id_end_date"})
                                        <div class="text-warning">@Html.ValidationMessageFor(model => model.EndDate)</div>
                                    </div>
                                </div>
                            </fieldset>
                            <div class="form-actions center">
                                <button class="btn btn-success" value="Save">
                                    <i class="icon-ok bigger-110"></i>Save
                                </button>
                            </div>
                        }
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
@section ScriptsText {
    @* $(document).ready( function(){
    $("#datepicker").datepicker({dateFormat: 'yy-mm-dd' });
    $("#id_end_date").datepicker({dateFormat: 'yy-mm-dd' });
  });*@
    
    <script type="text/javascript">
        $(function () {
            $('#popupDatepicker').datepick();
            $('#inlineDatepicker').datepick({ onSelect: showDate });
        });

        function showDate(date) {
            alert('The date chosen is ' + date);
        }
    </script> 
    @Scripts.Render("~/bundles/jqueryval")
}